<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>0_对象基础</title>
  </head>
  <body>
    <script>
      /*
      function Person(name) {
        this.name = name
        this.introduceSelf = function () {
          console.log(`我是${this.name}`)
        }
      }

      const salva = new Person('Salva')
      console.log(salva)
      salva.introduceSelf()

      const frankie = new Person('Frankie')
      frankie.introduceSelf()
      */
      class Person {
        constructor(name) {
          this.name = name
        }

        instroductSelf() {
          console.log(`我是${this.name}`)
        }
      }

      const p = new Person('Salva')
      console.log(p)
    </script>
  </body>
</html>
